<!DOCTYP html>
<html>
<head>
<meta charset="UTF-8">
<title>email abfrage</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>


<h1>Email Abfrage</h1>



<form action="email_abfrage.php" method="post" name="form" onsubmit="return checkmail()">


<table>
<tr><td align="right">Email:</td>
<td><input name="Mail1" type="text"> </td>
</tr>
<tr>
<td align="right">Email bestätigen:</td>
<td><input name="Mail2" type="text"> </td>
</tr>
<tr>
<td><input type="submit" value=" Absenden "></td>
</tr>
</table>
<script>
function checkmail(){
	var x = document.forms["form"]["Mail1"].value;
	var y = document.forms["form"]["Mail2"].value;
	
	if(x == "" || document.forms["form"]["Mail1"].value.indexOf("@") == -1){
		alert("Bitte Ihre korrekte E-Mail-Adresse eingeben!");
		document.forms["form"]["Mail1"].focus();
		return false;
	}
	if(y != x){
	alert("Bitte Ihre E-Mail-Adresse richtig bestätigen!");
	document.forms["form"]["Mail2"].focus();
	return false;
	}
}
</script>
</body>
</html>